feat(motd): message-of-the-day banner on every pilotctl command#253
Merged
Conversation
Add an always-on "message of the day" notice that the pilot team can
publish for a single UTC day at a time. It appears ahead of every
pilotctl command's output, and disappears on its own when cleared.
Design keeps both the CLI and the daemon off the hot path:
- The daemon is the only component that touches the network. A new
background loop (motdPollLoop) fetches the feed on --motd-interval
(default 15m), selects the entry dated for the current UTC day,
holds it in d.motd, and mirrors it to ~/.pilot/motd.json. Modeled
on the existing skill-reconciler loop — no new binary ships.
- pilotctl reads only that local mirror (one file read, no network,
no IPC) and re-validates the UTC day on read, so a stale mirror
never shows yesterday's message.
Output:
- text mode prepends "Message of the day: <text>"
- --json mode carries it as a top-level important_update envelope
field (text would break parsing); also surfaced as motd in info.
Clearing is first-class: an empty feed, a removed entry, or a blank
text all resolve to a cleared mirror within one poll interval.
New internal/motd package (pure-stdlib leaf): Fetch, Parse,
SelectForToday, WriteMirror, ReadActiveMirror, with unit tests for
UTC-day selection, stale-mirror rejection, and clearing. Daemon flags
--motd-feed-url / --motd-interval and PILOT_MOTD_URL env override.
Feed source: https://github.com/pilot-protocol/pilot-motd (motd.json).
Publishing is gated to maintainers with push access to the feed. The doc now describes only the feature, design, output, configuration, and semantics — not how to post or clear a message.
Alexgodoroja
added a commit
that referenced
this pull request
Jun 16, 2026
Adds the message-of-the-day banner (merged via #253). See CHANGELOG for the full entry. Co-authored-by: Alex Godoroja <alex@vulturelabs.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an always-on message of the day (MOTD) notice the pilot team can publish for a single UTC day at a time. It is prepended to every
pilotctlcommand's output, and disappears on its own when cleared.Design (fast CLI, no on-demand DB calls)
motdPollLoopfetches the feed every--motd-interval(default 15m), selects the entry dated for the current UTC day, holds it ind.motd, and mirrors it to~/.pilot/motd.json. Modeled on the existing skill-reconciler loop — no new binary ships.pilotctlreads only the local mirror — one file read, no network, no IPC — and re-validates the UTC day on read, so a stale mirror (daemon offline across midnight) never shows yesterday's message.Output
Message of the day: <text>.--jsonmode: carries it as a top-levelimportant_updateenvelope field (prepending text would break parsing); also surfaced asmotdinpilotctl info.Clearing is first-class
An empty feed, a removed entry, or a blank
textall resolve to a cleared mirror within one poll interval — committing an empty MOTD updates the value just like posting one.Changes
internal/motd(Fetch/Parse/SelectForToday/WriteMirror/ReadActiveMirror) + unit tests (UTC-day selection, stale-mirror rejection, clearing, HTTP fetch).motdfield,Config.MOTDFeedURL/MOTDInterval, poll loop, mirror path,DaemonInfo.MOTD,infoIPC field,--motd-feed-url/--motd-intervalflags +PILOT_MOTD_URL.cmd/pilotctl/motd.goreader, banner injection inmain(),important_updateinoutput/fatalCode/fatalHintenvelopes + tests.layers.yaml: classifyinternal/motdas a utility leaf.docs/motd.md: operator + design docs.Feed source
Consumes
motd.jsonfrom the new pilot-motd repo (separate PR). Default URL:https://raw.githubusercontent.com/pilot-protocol/pilot-motd/main/motd.json.Test
go build ./...,go vet, andgo test ./internal/motd/ ./cmd/pilotctl/ ./pkg/daemon/all pass. Smoke-tested with built binaries: text banner shows,important_updatepresent in--json, yesterday-dated mirror suppresses the banner.